package com.accesshollywood.indexables.items;

import java.util.Iterator;
import java.util.LinkedHashSet;

import com.accesshollywood.SQL.GFXSQL;
import com.accesshollywood.grfxOrdering.core.CoreTextSet;
import com.accesshollywood.indexables.AbstractIndexedSet;
import com.accesshollywood.indexables.Indexed;

public class TextSet extends AbstractIndexedSet {
	protected LinkedHashSet<TextIndexed>	set;//	= new LinkedHashSet<TextIndexed>();

	public TextSet(){
		super();
		this.set = super.set;
	}
	
	@Override
	public void initSQL() {
		setThat(this);
		tableName = "textList";
		idColumnName = "idTextList";
		elementColumnName.put(getField("set"), "idText");
	}

	public synchronized LinkedHashSet<TextIndexed> getSet() {
		return set;
	}

	public synchronized void setSet(LinkedHashSet<TextIndexed> set) {
		this.set = set;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((set == null) ? 0 : set.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		TextSet other = (TextSet) obj;
		if (set == null) {
			if (other.set != null)
				return false;
		} else if (!set.equals(other.set))
			return false;
		return true;
	}
}
